class AccessToken {
  late String accessToken;
  late String avatarBig;
  late String avatarMiddle;
  late String avatarThumb;
  late String avatarUrl;
  late String email;
  late String enName;
  late String enterpriseEmail;
  late int expiresIn;
  late String mobile;
  late String name;
  late String openId;
  late int refreshExpiresIn;
  late String refreshToken;
  late String tenantKey;
  late String tokenType;
  late String unionId;
  late String userId;

  AccessToken.fromJson(Map<String, dynamic> json) {
    var data = json['data'];
    accessToken = data['access_token'] ?? '';
    avatarBig = data['avatar_big'] ?? '';
    avatarMiddle = data['avatar_middle'] ?? '';
    avatarThumb = data['avatar_thumb'] ?? '';
    avatarUrl = data['avatar_url'] ?? '';
    email = data['email'] ?? '';
    enName = data['en_name'] ?? '';
    enterpriseEmail = data['enterprise_email'] ?? '';
    expiresIn = data['expires_in'] ?? 0;
    mobile = data['mobile'] ?? '';
    name = data['name'] ?? '';
    openId = data['open_id'] ?? '';
    refreshExpiresIn = data['refresh_expires_in'] ?? 0;
    refreshToken = data['refresh_token'] ?? '';
    tenantKey = data['tenant_key'] ?? '';
    tokenType = data['token_type'] ?? '';
    unionId = data['union_id'] ?? '';
    userId = data['user_id'] ?? '';
  }
}

class UserAccessToken {
  late int code;
  late AccessToken data;
  late String msg;

  UserAccessToken.fromJson(Map<String, dynamic> json) {
    code = json['code'] ?? 0;
    data = AccessToken.fromJson(json);
    msg = json['msg'] ?? '';
  }
}
